package com.funny.springcloud.controller;

import com.funny.springcloud.entities.Payment;
import com.funny.springcloud.feign.PaymentReignService;
import com.funny.springcloud.utils.R;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@Slf4j
@RestController
public class OrderController {

    @Resource
    private PaymentReignService paymentReignService;

    @GetMapping("/consumer/payment/get/{id}")
    public R<Payment> getPayment(@PathVariable("id") Long id) {
        return paymentReignService.getPayment(id);
    }

    @GetMapping("/consumer/payment/feign/timeout")
    public String paymentFeignTimeout() {
        return paymentReignService.paymentFeignTimeout();
    }
}
